import React, { Component } from 'react'
import subject from '@/assets/images/home/subject.png'
import LinearProgress from '@material-ui/core/LinearProgress'
import './index.less'
import { withRouter } from 'react-router-dom'



class List extends Component {
  handleClick(code) {
    // console.log(this);
    this.props.history.push('/choose/'+code)
  }
  render() {
    // console.log('list数据',this);
    return (
      <div className='list' style={{paddingBottom: '56px'}}>
        <ul>
          {this.props.listArr.map(item => 
            <li key={item.id}>
              <img src={subject} alt="" />
              <section>
                <div className="list_title" style={{lineHeight: '30px'}}>{item.title}</div>
                <div className="list_desc">{item.itemCount}/{item.itemCount}题</div>
                <LinearProgress variant="determinate" value={100}/>
              </section>
              <div className="btn" onClick={this.handleClick.bind(this,item.actionCode)}>练习</div>
            </li>
          )}
        </ul>
      </div>
    )
  }
}
export default withRouter(List)


